#ifndef __TSC_H__
#define __TSC_H__

extern int tscmsec;
extern long long tscsec; 
extern long long current_tsc;

// add by chad
/* read tsc interface */
#ifdef __x86_64__
#define rdtscll(val) do {                                          \
      unsigned int __a,__d;                                        \
      asm volatile("rdtsc" : "=a" (__a), "=d" (__d));              \
      (val) = ((unsigned long)__a) | (((unsigned long)__d) << 32); \
    } while (0)
#else
#define rdtscll(val)  do {                         \
      __asm__ __volatile__("rdtsc" : "=A" (val));  \
    } while (0)
#endif

void tsc_init ();

#endif
